﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTTB.Assembler;
using DTTB.DAO;
using DTTB.Domain;
using DTTB.DTO;

namespace DTTB.SERVICE
{
    public class PermissionsPerUsersService
    {
        PermissionsPerUsersAssembler PermissionsPerUsersAssembler = new PermissionsPerUsersAssembler();
        PermissionsPerUsersDao PermissionsPerUsersDao = new PermissionsPerUsersDao();


        public bool DeleteAllPermissionPerUserByUserId(string userId)
        {
            return PermissionsPerUsersDao.DeleteAllPermissionPerUserByUserId(userId);

           
        }


        public IList<PermissionsPerUsersDto> GetPermissionsPerUserByPathId(string pathId)
        {
            IList<PermissionsPerUsers> permissionsPerUserslist = PermissionsPerUsersDao.GetPermissionsPerUserByPathId(pathId);
            IList<PermissionsPerUsersDto> permissionsPerUsersDtoList = PermissionsPerUsersAssembler.ConvertToDataTransferObjectList(permissionsPerUserslist);

            return permissionsPerUsersDtoList;
        }

        public IList<PermissionsPerUsersDto> GetPermissionsPerUserByUserId(string userId)
        {
            IList<PermissionsPerUsers> permissionsPerUserslist = PermissionsPerUsersDao.GetPermissionsPerUserByUserId(userId);
            IList<PermissionsPerUsersDto> permissionsPerUsersDtoList = PermissionsPerUsersAssembler.ConvertToDataTransferObjectList(permissionsPerUserslist);

            return permissionsPerUsersDtoList;
        }

        public IList<PermissionsPerUsersDto> GetAllPermissionsPerUsers()
        {
            return PermissionsPerUsersAssembler.ConvertToDataTransferObjectList(this.PermissionsPerUsersDao.GetAllPermissionsPerUsers());
        }
    }
}
